package org.sunny.spring;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.sunny.autobean.Cat;
import org.sunny.config.MyBean;
import org.sunny.config.MyBean2;
import org.sunny.config.MyConfig;

public class Application {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext applicationContext =
                new AnnotationConfigApplicationContext(MyConfig.class);
        MyBean bean = applicationContext.getBean(MyBean.class);
        bean.print();
        MyBean2 bean2 = applicationContext.getBean(MyBean2.class);
        bean2.print();
        System.out.println(applicationContext.getBean(Cat.class));
        applicationContext.close();
    }

}
